package com.ruoyi.common.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 微信登录请求参数DTO
 * 用于接收前端传递的微信登录相关参数
 * @author 0617
 */
@Data
@ApiModel(value = "WechatLoginDTO", description = "微信登录请求参数")
public class WechatLoginDTO {

    @NotBlank(message = "微信登录code不能为空")
    @ApiModelProperty(value = "微信登录临时凭证code", required = true, example = "071E0000004c12f34567890abcdef")
    private String code;

    @ApiModelProperty(value = "用户昵称", example = "微信用户")
    private String nickname;

    @ApiModelProperty(value = "用户头像URL", example = "https://thirdwx.qlogo.cn/mmopen/vi_32/xxxxxx/132")
    private String avatarUrl;

    @ApiModelProperty(value = "用户性别 0-未知 1-男 2-女", example = "1")
    @Pattern(regexp = "^[012]$", message = "性别只能是0、1、2")
    private String gender;

    @ApiModelProperty(value = "用户所在城市", example = "深圳")
    private String city;

    @ApiModelProperty(value = "用户所在省份", example = "广东")
    private String province;

    @ApiModelProperty(value = "用户所在国家", example = "中国")
    private String country;

    @ApiModelProperty(value = "用户语言", example = "zh_CN")
    private String language;
}
